package org.ms.demo.rest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.client.discovery.DiscoveryClient;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by Administrator on 2017/12/18.
 */
@RestController
public class HelloController {
    @Autowired
    private DiscoveryClient discoveryClient;
    @RequestMapping("/hello")
    public String index(){
        return "Hello World";
    }

    @RequestMapping("/dc")
    public String dc() {
        String services = "Services: " + discoveryClient.getServices();
        System.out.println(services);
        return services;
    }
}
